<template>
  <div class="search-container">
    <el-input
      v-model="searchText"
      placeholder="请输入索引名称搜索"
      clearable
      @input="handleSearch"
    >
      <template #prefix>
        <el-icon><search /></el-icon>
      </template>
    </el-input>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'

const emit = defineEmits(['search'])

const searchText = ref('')

const handleSearch = () => {
  emit('search', searchText.value)
}
</script>

<style scoped>
.search-container {
  margin-bottom: 20px;
}
</style>
